$(function(){
    $.ajax({
        url:'http://localhost:3000/report/new',
        method:'GET',
        success:function(res){
            var str = '';
            $.each(res,function(index,item){
                str += "<li>"+
                "<div class=img>"+
                    "<img  src="+item.img+">"+
                "</div>"+
                "<div class=text>"+
                        "<p>"+item.text+"</p>"+
                        "<img src="+item.img+" >"+item.uName+""+
                        "<span class=time>2016-01-25</span>"+
                    "<div class=right>"+
                        "<img src=../css/img/xin.png>3"+
                        "<img src=../css/img/reply.png>3"+
                    "</div>"+
                "</div>"+
                "<div class=cccc>"+
                        "关于格列夫韦尼空气净化还有四篇报告，点击查看"+
                "</div>"+
            "</li>"
            })
            $('.report-con').html(str)
        }

    })

    $.ajax({
        url:'http://localhost:3000/report/hot',
        method:'GET',
        success:function(res1){
            var str1 = '';
            $.each(res1,function(index,item){
                str1 += "<li>"+
                "<div class=img>"+
                    "<img  src="+item.img+">"+
                "</div>"+
                "<div class=text>"+
                        "<p>"+item.text+"</p>"+
                        "<img src="+item.img+" >"+item.uName+""+
                        "<span class=time>2016-01-25</span>"+
                    "<div class=right>"+
                        "<img src=../css/img/xin.png>3"+
                        "<img src=../css/img/reply.png>3"+
                    "</div>"+
                "</div>"+
            "</li>"
            })
            $('.report2-con').html(str1)
        }

    })
    $('.tab_list li').click(function(){
        $(this).addClass('list-con').siblings('li').removeClass('list-con');
        var index = $(this).index();
        $(".tab_con .item").eq(index).show().siblings('.item').hide();
        
    })
    $('.more').click(function(){
        $('.report2-box').css('height','7030px')
        $('.report2').css('height','7030px')
        $('.report-box').css('height','5600px')
        $('.report').css('height','5600px')
        $(this).html('没有更多啦~').css('color','gray')
    })
})